cmake_minimum_required(VERSION 2.8)
project(core)

set(CORE_SOURCE_FILES
        include/opencv2/core/hal/hal.hpp
        include/opencv2/core/hal/interface.h
        include/opencv2/core/hal/intrin.hpp
        include/opencv2/core/hal/intrin_cpp.hpp
        include/opencv2/core/hal/intrin_neon.hpp
        include/opencv2/core/hal/intrin_sse.hpp
        include/opencv2/core/affine.hpp
        include/opencv2/core/base.hpp
        include/opencv2/core/bufferpool.hpp
        include/opencv2/core/core.hpp
        include/opencv2/core/core_c.h
        include/opencv2/core/cvdef.h
        include/opencv2/core/cvstd.hpp
        include/opencv2/core/cvstd.inl.hpp
        include/opencv2/core/fast_math.hpp
        include/opencv2/core/ippasync.hpp
        include/opencv2/core/mat.hpp
        include/opencv2/core/mat.inl.hpp
        include/opencv2/core/matx.hpp
        include/opencv2/core/neon_utils.hpp
        include/opencv2/core/operations.hpp
        include/opencv2/core/optim.hpp
        include/opencv2/core/persistence.hpp
        include/opencv2/core/private.hpp
        include/opencv2/core/ptr.inl.hpp
        include/opencv2/core/saturate.hpp
        include/opencv2/core/sse_utils.hpp
        include/opencv2/core/traits.hpp
        include/opencv2/core/types.hpp
        include/opencv2/core/types_c.h
        include/opencv2/core/utility.hpp
        include/opencv2/core/version.hpp
        include/opencv2/core/wimage.hpp
        include/opencv2/core.hpp
        include/cvconfig.h
        core/algorithm.cpp
        core/alloc.cpp
        core/persistence.cpp
        core/arithm.cpp
        core/arithm_core.hpp
        core/arithm_simd.hpp
        core/array.cpp
        core/bufferpool.impl.hpp
        core/command_line_parser.cpp
        core/conjugate_gradient.cpp
        core/convert.cpp
        core/copy.cpp
        core/datastructs.cpp
        core/downhill_simplex.cpp
        core/dxt.cpp
        core/glob.cpp
        core/hal_internal.cpp
        core/hal_internal.hpp
        core/hal_replacement.hpp
        core/kmeans.cpp
        core/lapack.cpp
        core/lda.cpp
        core/lpsolver.cpp
        core/mathfuncs.cpp
        core/mathfuncs_core.cpp
        core/matmul.cpp
        core/matop.cpp
        core/matrix.cpp
        core/matrix_decomp.cpp
        core/merge.cpp
        core/out.cpp
        core/parallel.cpp
        core/parallel_pthreads.cpp
        core/pca.cpp
        core/precomp.hpp
        core/rand.cpp
        core/split.cpp
        core/stat.cpp
        core/stl.cpp
        core/system.cpp
        core/core_tables.cpp
        core/types.cpp
        core/umatrix.cpp)

SET(IMGCODECS_SOURCE_FILES
        imgcodecs/bitstrm.cpp
        imgcodecs/bitstrm.hpp
        imgcodecs/grfmt_base.cpp
        imgcodecs/grfmt_base.hpp
        imgcodecs/grfmt_bmp.cpp
        imgcodecs/grfmt_bmp.hpp
        imgcodecs/grfmt_exr.cpp
        imgcodecs/grfmt_exr.hpp
        imgcodecs/grfmt_gdal.cpp
        imgcodecs/grfmt_gdal.hpp
        imgcodecs/grfmt_gdcm.cpp
        imgcodecs/grfmt_gdcm.hpp
        imgcodecs/grfmt_hdr.cpp
        imgcodecs/grfmt_hdr.hpp
        imgcodecs/grfmt_jpeg.cpp
        imgcodecs/grfmt_jpeg.hpp
        imgcodecs/grfmt_jpeg2000.cpp
        imgcodecs/grfmt_jpeg2000.hpp
        imgcodecs/grfmt_png.cpp
        imgcodecs/grfmt_png.hpp
        imgcodecs/grfmt_pxm.cpp
        imgcodecs/grfmt_pxm.hpp
        imgcodecs/grfmt_sunras.cpp
        imgcodecs/grfmt_sunras.hpp
        imgcodecs/grfmt_tiff.cpp
        imgcodecs/grfmt_tiff.hpp
        imgcodecs/grfmt_webp.cpp
        imgcodecs/grfmt_webp.hpp
        imgcodecs/grfmts.hpp
        imgcodecs/jpeg_exif.cpp
        imgcodecs/jpeg_exif.hpp
        imgcodecs/loadsave.cpp
        imgcodecs/precomp.hpp
        imgcodecs/rgbe.cpp
        imgcodecs/rgbe.hpp
        imgcodecs/imgcodecs_utils.cpp
        imgcodecs/imgcodecs_utils.hpp
        include/opencv2/imgcodecs/imgcodecs.hpp
        include/opencv2/imgcodecs/imgcodecs_c.h
        include/opencv2/imgcodecs.hpp
        )

SET(IMGPROC_SOURCE_FILES
        include/opencv2/imgproc/detail/distortion_model.hpp
        include/opencv2/imgproc/imgproc.hpp
        include/opencv2/imgproc/imgproc_c.h
        include/opencv2/imgproc/types_c.h
        include/opencv2/imgproc/hal/hal.hpp
        include/opencv2/imgproc/hal/interface.h
        include/opencv2/imgproc.hpp
        imgproc/_geom.h
        imgproc/accum.cpp
        imgproc/approx.cpp
        imgproc/blend.cpp
        imgproc/canny.cpp
        imgproc/clahe.cpp
        imgproc/color.cpp
        imgproc/colormap.cpp
        imgproc/connectedcomponents.cpp
        imgproc/contours.cpp
        imgproc/convhull.cpp
        imgproc/corner.cpp
        imgproc/cornersubpix.cpp
        imgproc/demosaicing.cpp
        imgproc/deriv.cpp
        imgproc/distransform.cpp
        imgproc/drawing.cpp
        imgproc/emd.cpp
        imgproc/featureselect.cpp
        imgproc/filter.cpp
        imgproc/filterengine.hpp
        imgproc/floodfill.cpp
        imgproc/gabor.cpp
        imgproc/gcgraph.hpp
        imgproc/generalized_hough.cpp
        imgproc/geometry.cpp
        imgproc/grabcut.cpp
        imgproc/hal_replacement.hpp
        imgproc/hershey_fonts.cpp
        imgproc/histogram.cpp
        imgproc/hough.cpp
        imgproc/imgwarp.cpp
        imgproc/intersection.cpp
        imgproc/linefit.cpp
        imgproc/lsd.cpp
        imgproc/main.cpp
        imgproc/matchcontours.cpp
        imgproc/min_enclosing_triangle.cpp
        imgproc/moments.cpp
        imgproc/morph.cpp
        imgproc/phasecorr.cpp
        imgproc/precomp.hpp
        imgproc/pyramids.cpp
        imgproc/rotcalipers.cpp
        imgproc/samplers.cpp
        imgproc/segmentation.cpp
        imgproc/shapedescr.cpp
        imgproc/smooth.cpp
        imgproc/spatialgradient.cpp
        imgproc/subdivision2d.cpp
        imgproc/sumpixels.cpp
        imgproc/imgproc_tables.cpp
        imgproc/templmatch.cpp
        imgproc/thresh.cpp
        imgproc/undistort.cpp
        imgproc/imgcodecs_utils.cpp)

add_executable(cv3_core_test ${CORE_SOURCE_FILES} ${IMGPROC_SOURCE_FILES} ${IMGCODECS_SOURCE_FILES} main.cpp)
target_include_directories(cv3_core_test PUBLIC ./include/)
target_link_libraries(cv3_core_test)

add_library(cv3_core STATIC ${CORE_SOURCE_FILES} ${IMGPROC_SOURCE_FILES} ${IMGCODECS_SOURCE_FILES})
target_include_directories(cv3_core PUBLIC ./include/)
